GtkRBNode *node;
GtkRBTree *tree;
GtkTreeViewColumn *column;
+ GtkBorder border;
};
static void gtk_tree_view_put (GtkTreeView *tree_view,
GtkWidget *child_widget,
GtkTreePath *path,
- GtkTreeViewColumn*column);
+ GtkTreeViewColumn*column,
+ const GtkBorder *border);
static gboolean gtk_tree_view_start_editing (GtkTreeView *tree_view,
GtkTreePath *cursor_path,
gboolean edit_only);
/* totally ignore our child's requisition */
path = _gtk_tree_path_new_from_rbtree (child->tree, child->node);
gtk_tree_view_get_cell_area (tree_view, path, child->column, &rect);
- allocation.x = rect.x;
- allocation.y = rect.y;
- allocation.width = rect.width;
- allocation.height = rect.height;
+ allocation.x = rect.x + child->border.left;
+ allocation.y = rect.y + child->border.top;
+ allocation.width = rect.width - (child->border.left + child->border.right);
+ allocation.height = rect.height - (child->border.top + child->border.bottom);
gtk_tree_path_free (path);
gtk_widget_size_allocate (child->widget, &allocation);
}
gtk_tree_view_put (GtkTreeView *tree_view,
GtkWidget *child_widget,
GtkTreePath *path,
- GtkTreeViewColumn *column)
+ GtkTreeViewColumn *column,
+ const GtkBorder *border)
{
GtkTreeViewChild *child;
g_assert_not_reached ();
}
child->column = column;
+ child->border = *border;
tree_view->priv->children = g_list_append (tree_view->priv->children, child);
GdkRectangle *cell_area)
{
GtkRequisition requisition;
+ GdkRectangle full_area;
+ GtkBorder border;
tree_view->priv->edited_column = column;
tree_view->priv->draw_keyfocus = TRUE;
+ gtk_tree_view_get_cell_area (tree_view, path, column, &full_area);
+ border.left = cell_area->x - full_area.x;
+ border.top = cell_area->y - full_area.y;
+ border.right = (full_area.x + full_area.width) - (cell_area->x + cell_area->width);
+ border.bottom = (full_area.y + full_area.height) - (cell_area->y + cell_area->height);
+
gtk_tree_view_put (tree_view,
GTK_WIDGET (cell_editable),
path,
- column);
+ column,
+ &border);
}
static void